/**
 * Copyright © 2009 Qasky. All rights reserved.
 *
 * 使用 VueX 进行状态管理
 *
 * @author Wang Hongya
 * @version 0.0.0 2019/10/14
 *
 * History:
 * (author, date, desc)
 * (Wang Hongya, 20191014, 添加注释)
 */
import Vue from 'vue';
import Vuex from 'vuex';

import app from './app';
import labManage from "./labManage";
import materialManage from "./materialManage";
import acManage from "./acManage";
import entryManage from "./entryManage";
import orderManage from "./orderManage";
import courseManage from "./courseManage";
import competitionManage from "./competitionManage";
import teamManage from "./teamManage";
import lessonManage from "./lessonManage";
import lineUpManage from "./lineUpManage";
import signManage from "./signManage";
import answerManage from "./answerManage";
import common from "./common";
import suggestManage from "./suggestManage";
import scoreManage from "./scoreManage";

Vue.use (Vuex)

export default new Vuex.Store({
    state: {
        httpError: {
            hasError: false,
            status: '',
            statusText: ''
        }
    },
    mutations: {
        ON_HTTP_ERROR(state, payload) {
            state.httpError = payload;
        }
    },
    actions: {},
    modules: {
        app,
        materialManage,
        labManage,
        acManage,
        entryManage,
        orderManage,
        courseManage,
        competitionManage,
        teamManage,
        lessonManage,
        lineUpManage,
        signManage,
        answerManage,
        suggestManage,
        scoreManage,
        common,
    },
    /*plugins: [createPersistedState({ storage: window.sessionStorage })]*/
})
